<!DOCTYPE html>
<html lang="en">





<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" type="image/png" href="/img/favicon.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="My Personal Website For Blog">
  <meta name="author" content="黄宇辉">
  <meta name="keywords" content="learning note,hexo blog">
  <title>Docker常用命令 - 欢迎参观小灰灰的网站哟 ヾ(◍°∇°◍)ﾉﾞ ~</title>

  <link  rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.staticfile.org/github-markdown-css/4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    <link  rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/10.0.0/styles/vs2015.min.css" />
  

  


<!-- 主题依赖的图标库，不要自行修改 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_yg9cfy8wd6.css">

<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_pjno9b9zyxs.css">

<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script  src="/js/utils.js" ></script>
</head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>ANONYMOUS</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                Home
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                Archives
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                Tags
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                About
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="view intro-2" id="background" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container text-center white-text fadeInUp">
            <span class="h2" id="subtitle">
              
            </span>

            
              
  <div class="mt-3 post-meta">
    <i class="iconfont icon-date-fill" aria-hidden="true"></i>
    <time datetime="2020-06-24 09:37">
      June 24, 2020 am
    </time>
  </div>


<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      1.8k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      29
       分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid">
  <div class="row">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-md">
      <div class="container nopadding-md" id="board-ctn">
        <div class="py-5" id="board">
          <div class="post-content mx-auto" id="post">
            
            <article class="markdown-body">
              <p><em>图解 Docker 常用命令</em></p>
<p><img src="/2020/06/24/Docker%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/docker-command.png" srcset="/img/loading.gif" alt=" "></p>
<h3 id="后台启动容器"><a href="#后台启动容器" class="headerlink" title="后台启动容器"></a>后台启动容器</h3><div class="hljs"><pre><code class="hljs shell"><span class="hljs-meta">#</span><span class="bash"> 查看所有镜像</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              latest              74435f89ab78        7 days ago          73.9MB
ubuntu              18.04               8e4ce0a6ce69        7 days ago          64.2MB
mysql               latest              be0dbf01a0f3        2 weeks ago         541MB
hello-world         latest              bf756fb1ae65        5 months ago        13.3kB
<span class="hljs-meta">
#</span><span class="bash"> 查看当前正在运行的容器</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
<span class="hljs-meta">
#</span><span class="bash"> 后来运行ubuntu容器</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker run -d ubuntu
6173c91e2589e3f43172805521a858e3ca242db72fcbf653849fac9216faf934
<span class="hljs-meta">
#</span><span class="bash"> 再次查看当前正在运行的容器，发现ubuntu并没有正在运行?!</span>
<span class="hljs-meta">#</span><span class="bash"> 这是因为docker没有发现应用便会自动停止，所以若要使得docker容器可以在后台启动并运行，则前台必须要有一个进程</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES</code></pre></div>


<h3 id="查看日志"><a href="#查看日志" class="headerlink" title="查看日志"></a>查看日志</h3><div class="hljs"><pre><code class="hljs shell"><span class="hljs-meta">#</span><span class="bash"> 查看logs命令的帮助文档</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker logs --help

Usage:  docker logs [OPTIONS] CONTAINER

Fetch the logs of a container

Options:
      --details        Show extra details provided to logs
  -f, --follow         Follow log output
      --since string   Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
      --tail string    Number of lines to show from the end of the logs (default "all")
  -t, --timestamps     Show timestamps
      --until string   Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
<span class="hljs-meta">
#</span><span class="bash"> 查看当前正在运行的容器(无)</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker ps                                                                                 
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES        
<span class="hljs-meta">
#</span><span class="bash"> 执行 docker run -d &lt;容器名称&gt; 后台启动 ubuntu 容器并在该容器中创建一个进程( 一段shell脚本 )以防止docker容器没有发现进程而自动停止</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker run -d ubuntu /bin/sh -c "while true;do echo 'this is logs..';sleep 1;done"        
b89578415781997955293bbff1ccfc849bf8cad0f6af30193a16d51e576862b2                                                       
ubuntu@VM-0-4-ubuntu:~$ sudo docker ps                                                                                 
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS          NAMES      
b89578415781        ubuntu              "/bin/sh -c 'while t…"   9 seconds ago       Up 7 seconds                       jovial_nightingale            
<span class="hljs-meta">
#</span><span class="bash"> 根据指定容器id来查看容器的日志信息</span>
<span class="hljs-meta">#</span><span class="bash"> -tf : 显示日志</span>
<span class="hljs-meta">#</span><span class="bash"> --tail number : 显示日志的条数 </span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker logs -tf --tail 5 b89578415781                                                     
2020-06-24T02:01:55.077195969Z this is logs..                                                                          
2020-06-24T02:01:56.081186346Z this is logs..                                                                          
2020-06-24T02:01:57.085186008Z this is logs..                                                                          
2020-06-24T02:01:58.089245329Z this is logs..                                                                          
2020-06-24T02:01:59.093251030Z this is logs..                                                                          
2020-06-24T02:02:00.097191092Z this is logs..                                                                          
2020-06-24T02:02:01.101183828Z this is logs..                                                                          
2020-06-24T02:02:02.105495333Z this is logs..                                                                          
2020-06-24T02:02:03.109132666Z this is logs..                                                                          
^C  # ctrl + c                                                                                                                   
ubuntu@VM-0-4-ubuntu:~$</code></pre></div>


<h3 id="查看容器中的进程信息"><a href="#查看容器中的进程信息" class="headerlink" title="查看容器中的进程信息"></a>查看容器中的进程信息</h3><div class="hljs"><pre><code class="hljs shell"><span class="hljs-meta">#</span><span class="bash"> 查看当前正在运行的容器</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS              NAMES
5f39caf62a73        ubuntu              "/bin/sh -c 'while t…"   6 seconds ago       Up 4 seconds                           magical_leakey
<span class="hljs-meta">
#</span><span class="bash"> 根据容器id查看当前正在运行的ubuntu容器的进程信息</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker top 5f39caf62a73
UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
root                17430               17403               0                   10:14               ?                   00:00:00            /bin/sh -c while true;do echo 'this is logs..';sleep 1;done
root                17532               17430               0                   10:14               ?
 00:00:00            sleep 1</code></pre></div>


<h3 id="查看镜像的元数据"><a href="#查看镜像的元数据" class="headerlink" title="查看镜像的元数据"></a>查看镜像的元数据</h3><div class="hljs"><pre><code class="hljs shell"><span class="hljs-meta">#</span><span class="bash"> 查看inspect的帮助命令</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker inspect --help

Usage:  docker inspect [OPTIONS] NAME|ID [NAME|ID...]

Return low-level information on Docker objects

Options:
  -f, --format string   Format the output using the given Go template
  -s, --size            Display total file sizes if the type is container
      --type string     Return JSON for specified type
<span class="hljs-meta">
#</span><span class="bash"> 查看当前正在运行的容器</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker ps                                                                                 
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS              NAMES
5f39caf62a73        ubuntu              "/bin/sh -c 'while t…"   7 minutes ago       Up 7 minutes                           magical_leakey
<span class="hljs-meta">
#</span><span class="bash"> 根据容器id查看当前正在运行的ubuntu镜像的元数据</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker inspect 5f39caf62a73                                                               
[                                                                                                                      
    &#123;                                                                                                                  
        "Id": "5f39caf62a73c3f59c2e153a2215d4b99520b9015955257e3a94ee758cb5ed4e",                                      
        "Created": "2020-06-24T02:14:16.639468062Z",                                                                   
        "Path": "/bin/sh",                                                                                             
        "Args": [                                                                                                      
            "-c",                                                                                                      
            "while true;do echo 'this is logs..';sleep 1;done"                                                         
        ],                                                                                                             
        "State": &#123;                                                                                                     
            "Status": "running",                                                                                       
            "Running": true,                                                                                           
            "Paused": false,                                                                                           
            "Restarting": false,                                                                                       
            "OOMKilled": false,                                                                                        
            "Dead": false,                                                                                             
            "Pid": 17430,                                                                                              
            "ExitCode": 0,                                                                                             
            "Error": "",                                                                                               
            "StartedAt": "2020-06-24T02:14:18.033196262Z",                                                             
            "FinishedAt": "0001-01-01T00:00:00Z"                                                                       
        &#125;

. . . . . .</code></pre></div>


<h3 id="进入当前正在运行的容器"><a href="#进入当前正在运行的容器" class="headerlink" title="进入当前正在运行的容器"></a>进入当前正在运行的容器</h3><div class="hljs"><pre><code class="hljs shell"><span class="hljs-meta">#</span><span class="bash"> 查看当前正在运行的容器</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS              NAMES
5f39caf62a73        ubuntu              "/bin/sh -c 'while t…"   33 minutes ago      Up 33 minutes                          magical_leakey
<span class="hljs-meta">
#</span><span class="bash"> 方式一 : docker <span class="hljs-built_in">exec</span> -it &lt;容器id&gt; /bin/bash</span>
<span class="hljs-meta">#</span><span class="bash"> 根据id进入当前正在运行的ubuntu容器，特征为进入容器后开启一个新的终端</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker exec -it 5f39caf62a73 /bin/bash
root@5f39caf62a73:/# ls
bin  boot  dev  etc  home  lib  lib32  lib64  libx32  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
<span class="hljs-meta">

#</span><span class="bash"> 方式二 : docker attach &lt;容器id&gt;</span>
<span class="hljs-meta">#</span><span class="bash"> 根据id进入当前正在运行的ubuntu容器，特征为进入一个容器正在执行的终端</span>
ubuntu@VM-0-4-ubuntu:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS
      NAMES
ed8c6b026ee1        ubuntu              "/bin/sh -c 'while t…"   7 seconds ago       Up 5 seconds
      stupefied_boyd
ubuntu@VM-0-4-ubuntu:~$ sudo docker attach ed8c6b026ee1
this is logs..
this is logs..
this is logs..
this is logs..
this is logs..
this is logs..
^Cubuntu@VM-0-4-ubuntu:~$</code></pre></div>


<h3 id="从容器内拷贝文件到主机上"><a href="#从容器内拷贝文件到主机上" class="headerlink" title="从容器内拷贝文件到主机上"></a>从容器内拷贝文件到主机上</h3><div class="hljs"><pre><code class="hljs shell"><span class="hljs-meta">#</span><span class="bash"> 查看当前正在运行的容器(无)</span>
ubuntu@VM-0-4-ubuntu:/home$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS              NAMES
<span class="hljs-meta">
#</span><span class="bash"> 查看所有镜像</span>
ubuntu@VM-0-4-ubuntu:/home$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              latest              74435f89ab78        7 days ago          73.9MB
ubuntu              18.04               8e4ce0a6ce69        7 days ago          64.2MB
mysql               latest              be0dbf01a0f3        2 weeks ago         541MB
hello-world         latest              bf756fb1ae65        5 months ago        13.3kB
<span class="hljs-meta">
#</span><span class="bash"> 进入名为ubuntu的docker容器</span>
ubuntu@VM-0-4-ubuntu:/home$ sudo docker run -it ubuntu /bin/bash
root@2f8d86d683f2:/# cd home/
root@2f8d86d683f2:/home# ls
root@2f8d86d683f2:/home# touch ishacker.net.java # 在容器/home目录下创建一个名为 ishacker.net.java 的文件
root@2f8d86d683f2:/home# ls
ishacker.net.java
root@2f8d86d683f2:/home# exit # 退出容器，返回主机terminal
exit
<span class="hljs-meta">
#</span><span class="bash"> 查看容器的运行历史记录</span>
ubuntu@VM-0-4-ubuntu:/home$ sudo docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                PORTS               NAMES
2f8d86d683f2        ubuntu              "/bin/bash"              51 seconds ago      Exited (0) 13 seconds ago                  vibrant_lumiere
ed8c6b026ee1        ubuntu              "/bin/sh -c 'while t…"   11 minutes ago      Exited (130) 11 minutes ago                stupefied_boyd
<span class="hljs-meta">
#</span><span class="bash"> 将刚刚进入的，id为 2f8d86d683f2 容器中的 ishacker.net.java 文件拷贝到当前主机的/home目录中</span>
ubuntu@VM-0-4-ubuntu:/home$ ls
ubuntu
ubuntu@VM-0-4-ubuntu:/home$ sudo docker cp 2f8d86d683f2:/home/ishacker.net.java /home
ubuntu@VM-0-4-ubuntu:/home$ ls
ishacker.net.java  ubuntu</code></pre></div>


<h3 id="小结"><a href="#小结" class="headerlink" title="小结"></a>小结</h3><p>其中 &lt;&gt; 括起来的参数为必选，而 [] 括起来为可选.</p>
<ul>
<li><code>docker version</code> : 查看docker的版本号，包括客户端、服务端、依赖的Go等</li>
<li><code>docker info</code> : 查看系统(docker)层面信息，包括管理的images, containers数等</li>
<li><code>docker search &lt;image&gt;</code> : 在docker index中搜索image</li>
<li><code>docker pull &lt;image&gt;</code> : 从docker registry server 中下拉image</li>
<li><code>docker inspect &lt;image|container&gt;</code> : 查看image或container的底层信息</li>
<li><code>docker images -a</code> : 列出所有的images</li>
<li><code>docker ps</code> : 默认显示正在运行中的container</li>
<li><code>docker ps -l</code> : 显示最后一次创建的container，包括未运行的</li>
<li><code>docker ps -a</code> : 显示所有的container，包括未运行的</li>
<li><code>docker logs &lt;container&gt;</code> : 查看container的日志，也就是执行命令的一些输出</li>
<li><code>docker rm &lt;container...&gt;</code> : 删除一个或多个container</li>
<li><code>docker rm docker ps -a -q</code> 删除所有的container</li>
<li><code>docker ps -a -q | xargs docker rm</code> : 同上, 删除所有的container</li>
<li><code>docker rmi &lt;image...&gt;</code> : 删除一个或多个image</li>
<li><code>docker start/stop/restart &lt;container&gt;</code> : 开启/停止/重启container</li>
<li><code>docker start -i &lt;container&gt;</code> : 启动一个container并进入交互模式</li>
<li><code>docker attach &lt;container&gt;</code> : attach一个运行中的container</li>
<li><code>docker run &lt;image&gt; &lt;command&gt;</code> : 使用image创建container并执行相应命令，然后停止</li>
<li><code>docker run -i -t &lt;image&gt; /bin/bash</code> : 使用image创建container并进入交互模式, login shell是/bin/bash</li>
<li><code>docker run -i -t -p &lt;host_port:contain_port&gt;</code> : 将container的端口映射到宿主机的端口</li>
</ul>
<h3 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h3><p>更多 Docker 常用命令总结请参考如下两篇文章 : </p>
<ul>
<li><a href="http://www.ha97.com/5546.html" target="_blank" rel="noopener">http://www.ha97.com/5546.html</a></li>
<li><a href="https://www.cnblogs.com/Wshile/p/12988720.html" target="_blank" rel="noopener">https://www.cnblogs.com/Wshile/p/12988720.html</a></li>
</ul>

            </article>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/Docker/">Docker</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" target="_blank" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！</p>
              
              
                <div class="post-prevnext row">
                  <div class="post-prev col-6">
                    
                    
                      <a href="/2020/06/24/Docker%E5%AE%89%E8%A3%85%E5%B9%B6%E9%83%A8%E7%BD%B2nginx/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Docker安装并部署nginx</span>
                        <span class="visible-mobile">Previous</span>
                      </a>
                    
                  </div>
                  <div class="post-next col-6">
                    
                    
                      <a href="/2020/06/23/Docker%E9%95%9C%E5%83%8F%E5%8F%8A%E5%AE%B9%E5%99%A8%E7%9A%84%E5%9F%BA%E6%9C%AC%E5%91%BD%E4%BB%A4/">
                        <span class="hidden-mobile">Docker镜像及容器的基本命令</span>
                        <span class="visible-mobile">Next</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </div>
                </div>
              
            </div>

            
          </div>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;TOC</p>
  <div id="tocbot"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">Search</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">keyword</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  

  <footer class="mt-5">
  <div class="text-center py-3">
    <div>
      <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a>
      <i class="iconfont icon-love"></i>
      <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener">
        <span>Fluid</span></a>
    </div>
    
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


    

    
  </div>
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/js/debouncer.js" ></script>
<script  src="/js/main.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/lazyload.js" ></script>
  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/js/clipboard-use.js" ></script>



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>





  <script  src="https://cdn.staticfile.org/tocbot/4.11.1/tocbot.min.js" ></script>
  <script>
    $(document).ready(function () {
      var boardCtn = $('#board-ctn');
      var boardTop = boardCtn.offset().top;

      tocbot.init({
        tocSelector: '#tocbot',
        contentSelector: 'article.markdown-body',
        headingSelector: 'h1,h2,h3,h4,h5,h6',
        linkClass: 'tocbot-link',
        activeLinkClass: 'tocbot-active-link',
        listClass: 'tocbot-list',
        isCollapsedClass: 'tocbot-is-collapsed',
        collapsibleClass: 'tocbot-is-collapsible',
        collapseDepth: 0,
        scrollSmooth: true,
        headingsOffset: -boardTop
      });
      if ($('.toc-list-item').length > 0) {
        $('#toc').css('visibility', 'visible');
      }
    });
  </script>



  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    var typed = new Typed('#subtitle', {
      strings: [
        '  ',
        "Docker常用命令&nbsp;",
      ],
      cursorChar: "_",
      typeSpeed: 70,
      loop: false,
    });
    typed.stop();
    $(document).ready(function () {
      $(".typed-cursor").addClass("h2");
      typed.start();
    });
  </script>



  <script  src="https://cdn.staticfile.org/anchor-js/4.2.2/anchor.min.js" ></script>
  <script>
    anchors.options = {
      placement: "right",
      visible: "hover",
      
    };
    var el = "h1,h2,h3,h4,h5,h6".split(",");
    var res = [];
    for (item of el) {
      res.push(".markdown-body > " + item)
    }
    anchors.add(res.join(", "))
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    var path = "/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>



  <script  src="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.css" />

  <script>
    $('#post img:not(.no-zoom img, img[no-zoom]), img[zoom]').each(
      function () {
        var element = document.createElement('a');
        $(element).attr('data-fancybox', 'images');
        $(element).attr('href', $(this).attr('src'));
        $(this).wrap(element);
      }
    );
  </script>







  
  
    <script>
      !function (e, t, a) {
        function r() {
          for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
          requestAnimationFrame(r)
        }

        function n() {
          var t = "function" == typeof e.onclick && e.onclick;
          e.onclick = function (e) {
            t && t(), o(e)
          }
        }

        function o(e) {
          var a = t.createElement("div");
          a.className = "heart", s.push({
            el: a,
            x: e.clientX - 5,
            y: e.clientY - 5,
            scale: 1,
            alpha: 1,
            color: c()
          }), t.body.appendChild(a)
        }

        function i(e) {
          var a = t.createElement("style");
          a.type = "text/css";
          try {
            a.appendChild(t.createTextNode(e))
          } catch (t) {
            a.styleSheet.cssText = e
          }
          t.getElementsByTagName("head")[0].appendChild(a)
        }

        function c() {
          return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
        }

        var s = [];
        e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
          setTimeout(e, 1e3 / 60)
        }, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r()
      }(window, document);
    </script>
  














</body>
</html>
